removed Paolo Molaro's type creation hooks again, since they 1) don't care
authorTim Janik <timj@gtk.org>
Mon, 11 Jan 1999 12:43:07 +0000 (12:43 +0000)
committerTim Janik <timj@src.gnome.org>
Mon, 11 Jan 1999 12:43:07 +0000 (12:43 +0000)
Mon Jan 11 13:31:49 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtktypeutils.[hc]: removed Paolo Molaro's type creation hooks
        again, since they 1) don't care about infinite recursion (likely
        to achive), 2) we are in feature freeze for 1.2. this definitely
        deserves a sane implementation in 1.3 though (but without a hook
        return value, without seq_id hackery and with recursion checks).

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktypeutils.c
gtk/gtktypeutils.h

index fd6528f241907edac7eff98eff8c686be475f951..51776c0a2babb3f454ec527def7a13070851f73a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Mon Jan 11 13:31:49 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.[hc]: removed Paolo Molaro's type creation hooks
+       again, since they 1) don't care about infinite recursion (likely
+       to achive), 2) we are in feature freeze for 1.2. this definitely
+       deserves a sane implementation in 1.3 though (but without a hook
+       return value, without seq_id hackery and with recursion checks).
+
 Mon Jan 11 13:18:37 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkwindow.c:
index fd6528f241907edac7eff98eff8c686be475f951..51776c0a2babb3f454ec527def7a13070851f73a 100644 (file)
@@ -1,3 +1,11 @@
+Mon Jan 11 13:31:49 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.[hc]: removed Paolo Molaro's type creation hooks
+       again, since they 1) don't care about infinite recursion (likely
+       to achive), 2) we are in feature freeze for 1.2. this definitely
+       deserves a sane implementation in 1.3 though (but without a hook
+       return value, without seq_id hackery and with recursion checks).
+
 Mon Jan 11 13:18:37 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkwindow.c:
index fd6528f241907edac7eff98eff8c686be475f951..51776c0a2babb3f454ec527def7a13070851f73a 100644 (file)
@@ -1,3 +1,11 @@
+Mon Jan 11 13:31:49 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.[hc]: removed Paolo Molaro's type creation hooks
+       again, since they 1) don't care about infinite recursion (likely
+       to achive), 2) we are in feature freeze for 1.2. this definitely
+       deserves a sane implementation in 1.3 though (but without a hook
+       return value, without seq_id hackery and with recursion checks).
+
 Mon Jan 11 13:18:37 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkwindow.c:
index fd6528f241907edac7eff98eff8c686be475f951..51776c0a2babb3f454ec527def7a13070851f73a 100644 (file)
@@ -1,3 +1,11 @@
+Mon Jan 11 13:31:49 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.[hc]: removed Paolo Molaro's type creation hooks
+       again, since they 1) don't care about infinite recursion (likely
+       to achive), 2) we are in feature freeze for 1.2. this definitely
+       deserves a sane implementation in 1.3 though (but without a hook
+       return value, without seq_id hackery and with recursion checks).
+
 Mon Jan 11 13:18:37 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkwindow.c:
index fd6528f241907edac7eff98eff8c686be475f951..51776c0a2babb3f454ec527def7a13070851f73a 100644 (file)
@@ -1,3 +1,11 @@
+Mon Jan 11 13:31:49 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.[hc]: removed Paolo Molaro's type creation hooks
+       again, since they 1) don't care about infinite recursion (likely
+       to achive), 2) we are in feature freeze for 1.2. this definitely
+       deserves a sane implementation in 1.3 though (but without a hook
+       return value, without seq_id hackery and with recursion checks).
+
 Mon Jan 11 13:18:37 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkwindow.c:
index fd6528f241907edac7eff98eff8c686be475f951..51776c0a2babb3f454ec527def7a13070851f73a 100644 (file)
@@ -1,3 +1,11 @@
+Mon Jan 11 13:31:49 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.[hc]: removed Paolo Molaro's type creation hooks
+       again, since they 1) don't care about infinite recursion (likely
+       to achive), 2) we are in feature freeze for 1.2. this definitely
+       deserves a sane implementation in 1.3 though (but without a hook
+       return value, without seq_id hackery and with recursion checks).
+
 Mon Jan 11 13:18:37 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkwindow.c:
index fd6528f241907edac7eff98eff8c686be475f951..51776c0a2babb3f454ec527def7a13070851f73a 100644 (file)
@@ -1,3 +1,11 @@
+Mon Jan 11 13:31:49 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtktypeutils.[hc]: removed Paolo Molaro's type creation hooks
+       again, since they 1) don't care about infinite recursion (likely
+       to achive), 2) we are in feature freeze for 1.2. this definitely
+       deserves a sane implementation in 1.3 though (but without a hook
+       return value, without seq_id hackery and with recursion checks).
+
 Mon Jan 11 13:18:37 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkwindow.c:
index dc33bc84d980d4d86e3d148f4e60df382be68049..139507bd8e3f580bf1d5905c3c96e321a782dfbc 100644 (file)
@@ -65,7 +65,6 @@ static guint      n_type_nodes = 0;
 static guint       n_ftype_nodes = 0;
 static GHashTable  *type_name_2_type_ht = NULL;
 
-static GHookList *creation_hook_list = NULL;
 
 static GtkTypeNode*
 gtk_type_node_next_and_invalidate (GtkType parent_type)
@@ -228,15 +227,6 @@ gtk_type_create (GtkType      parent_type,
   return new_node->type;
 }
 
-static gboolean
-gtk_creation_marshaller (GHook* hook, gpointer data)
-{
-  GtkTypeQuery *query = (GtkTypeQuery*) data;
-  GtkCreationHook func = hook->func;
-  
-  return func(query, hook->data);
-}
-
 GtkType
 gtk_type_unique (GtkType      parent_type,
                 const GtkTypeInfo *type_info)
@@ -262,16 +252,6 @@ gtk_type_unique (GtkType      parent_type,
   
   if (!new_type)
     g_free (type_name);
-  else if ( creation_hook_list )
-    {
-      GtkTypeQuery data;
-      data.type = new_type;
-      data.type_name = type_name;
-      data.object_size = type_info->object_size;
-      data.class_size = type_info->class_size;
-
-      g_hook_list_marshal_check(creation_hook_list, FALSE, gtk_creation_marshaller, &data);
-    }
 
   return new_type;
 }
@@ -1034,40 +1014,3 @@ gtk_identifier_get_type (void)
   
   return identifier_type;
 }
-
-guint
-gtk_type_add_creation_hook (GtkCreationHook hook_func,
-                            gpointer        data,
-                            GDestroyNotify  destroy)
-{
-  static guint seq_id =1;
-  GHook * hook;
-  
-  g_return_val_if_fail(hook_func != NULL, 0);
-
-  if (!creation_hook_list)
-    {
-      creation_hook_list = g_new(GHookList, 1);
-      g_hook_list_init(creation_hook_list, sizeof(GHook));
-    }
-
-  hook = g_hook_alloc (creation_hook_list);
-  hook->data = data;
-  hook->func = hook_func;
-  hook->destroy = destroy;
-
-  creation_hook_list->seq_id = seq_id;
-  g_hook_prepend(creation_hook_list, hook);
-  seq_id = creation_hook_list->seq_id;
-
-  return hook->hook_id;
-}
-
-void
-gtk_type_remove_creation_hook (guint hook_id)
-{
-  g_return_if_fail(hook_id != 0);
-
-  if (!creation_hook_list || !g_hook_destroy(creation_hook_list, hook_id))
-    g_warning("gtk_type_remove_creation_hook(): could not find hook (%u)", hook_id);
-}
index 5b42840ce52158abc1e6e90d8dcea789a7991a9e..1caea5137bb213adf252e948e8794f8d1f69e53e 100644 (file)
@@ -153,8 +153,6 @@ typedef void (*GtkSignalMarshaller) (GtkObject      *object,
                                     GtkSignalFunc   func,
                                     gpointer        func_data,
                                     GtkArg         *args);
-typedef gboolean (*GtkCreationHook) (GtkTypeQuery   *type_info,
-                                     gpointer        data);
 
 /* deprecated */
 typedef void (*GtkArgGetFunc)     (GtkObject*, GtkArg*, guint);
@@ -363,11 +361,6 @@ GtkType            gtk_type_get_varargs_type       (GtkType        foreign_type);
  */
 GtkTypeQuery*  gtk_type_query                  (GtkType        type);
 
-guint           gtk_type_add_creation_hook      (GtkCreationHook hook,
-                                                 gpointer        data,
-                                                 GDestroyNotify  destroy);
-void            gtk_type_remove_creation_hook   (guint           hook_id);
-
 
 
 #ifdef __cplusplus